﻿using SharpSoft.Web;
using System;
using System.Collections.Generic;
using System.Text;

namespace SharpSoft.BL
{
    public class UserForMtps : UserDefault
    {
        
        public new int UserId { get { return int.Parse(base.UserId); } set { base.UserId = value.ToString(); } }
        public int? EnterpriseId
        {
            get
            {
                string[] vs = UserData.Split(',');
                if (!string.IsNullOrEmpty(vs[0]))
                {
                    return int.Parse(vs[0]);
                }
                else
                {
                    return null;
                }
            }
        }
        public int? CompanyId
        {
            get
            {
                string[] vs = UserData.Split(',');
                if (!string.IsNullOrEmpty(vs[1]))
                {
                    return int.Parse(vs[1]);
                }
                else
                {
                    return null;
                }
            }
        }
        
        public string UserToken { get; set; }

        public bool IsMainAccount
        {
            get
            {
                return bool.Parse(UserData.Split(',')[2]);
            }
        }
    }
}
